package com.dao;

import com.core.model.AbstractEntity;
import org.apache.poi.ss.formula.functions.T;
import org.hibernate.Session;

import java.util.List;

public interface EntityDao {

    Session currentSession();

    <T extends AbstractEntity> void saveOrUpdate(T t);

    <T extends AbstractEntity> void saveOrUpdate(List<T> t);

    <T extends AbstractEntity> void delObject(Object t);

    <T extends AbstractEntity> T load(Class<T> clazz, String id);

    <T extends AbstractEntity> T get(Class<T> clazz, String id);

    <T extends AbstractEntity> List<T> findAll(Class<T> t);

    <T extends AbstractEntity> List<T> findAll(Class<T> t, boolean active);

    <T extends AbstractEntity> List<T> findAll(Class<T> t, String currentPage);

    <T extends AbstractEntity> List<T> findAllOrderBy(Class<T> t, String orderBy);

    <T extends AbstractEntity> List<T> findActiveEntities(Class<T> t);

    <T extends AbstractEntity> List<T> findDeactiveEntities(Class<T> t);

    <T extends AbstractEntity> String findTotalPage(Class<T> t);

    <T extends AbstractEntity> void deactive(String guid, Class<T> clazz);

    <T extends AbstractEntity> void active(String guid, Class<T> clazz);

    <T extends AbstractEntity> void delete(String guid, Class<T> clazz);

    <T extends AbstractEntity> T findByGuid(Class<T> clazz, String guid);

    <T extends AbstractEntity> T findIsExistByGuid(Class<T> clazz, String guid);

    <T extends AbstractEntity> List<T> findByGuids(Class<T> clazz, List<String> guids);

    <T extends AbstractEntity> List<T> findByGuids(String[] guids, Class<T> clazz);

    <T extends AbstractEntity> List<T> findByGuids(Class<T> clazz, String... guids);
}
